<template>
  <div class="row justify-content-center">
    <div class="col-8">
      <div v-if="userClass">
        <h2 class="jh-entity-heading" data-cy="userClassDetailsHeading"><span>UserClass</span> {{ userClass.id }}</h2>
        <dl class="row jh-entity-details">
          <dt>
            <span>Class Id</span>
          </dt>
          <dd>
            <span>{{ userClass.classId }}</span>
          </dd>
          <dt>
            <span>Start Time</span>
          </dt>
          <dd>
            <span>{{ userClass.startTime | formatDate }}</span>
          </dd>
          <dt>
            <span>End Time</span>
          </dt>
          <dd>
            <span>{{ userClass.endTime | formatDate }}</span>
          </dd>
          <dt>
            <span>Class Number</span>
          </dt>
          <dd>
            <span>{{ userClass.classNumber }}</span>
          </dd>
          <dt>
            <span>Class Status</span>
          </dt>
          <dd>
            <span>{{ userClass.classStatus }}</span>
          </dd>
          <dt>
            <span>Course</span>
          </dt>
          <dd>
            <div v-if="userClass.course">
              <router-link :to="{ name: 'CourseView', params: { courseId: userClass.course.id } }">{{ userClass.course.id }}</router-link>
            </div>
          </dd>
        </dl>
        <button type="submit" v-on:click.prevent="previousState()" class="btn btn-info" data-cy="entityDetailsBackButton">
          <font-awesome-icon icon="arrow-left"></font-awesome-icon>&nbsp;<span> Back</span>
        </button>
        <router-link
          v-if="userClass.id"
          :to="{ name: 'UserClassEdit', params: { userClassId: userClass.id } }"
          custom
          v-slot="{ navigate }"
        >
          <button @click="navigate" class="btn btn-primary">
            <font-awesome-icon icon="pencil-alt"></font-awesome-icon>&nbsp;<span> Edit</span>
          </button>
        </router-link>
      </div>
    </div>
  </div>
</template>

<script lang="ts" src="./user-class-details.component.ts"></script>
